function object(o) {
    function F(o) {
        F.prototype = o;
        return F;
    }
    return new F(o);
}
function inheritPrototype(subType, superType) {
    var prototype = object(superType.prototype);
    // 创建了父类原型的浅复制
    prototype.constructor = subType;
    // 修正原型的构造函数
    subType.prototype = prototype;
    // 将子类的原型替换为这个原型
}
(function aaa() {
    alert("123")
})();
function SuperType(name) {
    this.name = name;

    this.colors = ["red", "blue", "green"];
}
SuperType.prototype.sayName = function() {
    alert(this.name);
};
function SubType(name, age) {
    SuperType.call(this, name);

    this.age = age;
}
// 核心：因为是对父类原型的复制，所以不包含父类的构造函数，也就不会调用两次父类的构造函数造成浪费
inheritPrototype(SubType, SuperType);
SubType.prototype.sayAge = function() {
    alert(this.age);
};